-
-
Notifications
You must be signed in to change notification settings - Fork 398
fix: redirect postinstall script output to runtime output #2090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b557895
to
66778a2
Compare
6818d0c
to
66c0fe0
Compare
4acfd20
to
0929b19
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2090 +/- ##
==========================================
+ Coverage 36.46% 36.54% +0.08%
==========================================
Files 229 229
Lines 19610 19624 +14
==========================================
+ Hits 7151 7172 +21
+ Misses 11618 11608 -10
- Partials 841 844 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
986ee94
to
abf2810
Compare
abf2810
to
4ae9826
Compare
5d19485
to
1bc3537
Compare
c06fda3
to
b7f2357
Compare
ad1fabf
to
17ab168
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, let's wait for a test on the IDE by @ubidefeo :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally sound.
I reported that while the Please run as root
message is displayed to the user,
the installation is reported as finished, hence successful.
$> arduino-cli core install arduino:mbed_nano
Configuring platform....
Please run as root
...
Platform arduino:[email protected] installed
$>
Running
$> sudo arduino-cli core install arduino:mbed_nano
Platform arduino:[email protected] already installed
Will fail to reinstall the platform and run the post-install required installers.
This forces the user to uninstall
and then sudo
to install the platform again.
Platforms should receive an update to the script to trigger an exit code !=0
in case not invoked as root
@ubidefeo I asked you to test on the IDE, we already tested the
This may be a practical procedure for the CLI, but I don't think the users from the IDE will be happy to run the whole IDE as root...
If your proposal is to un-do the installation (remove all the platforms/tools just installed) if the post-install script fails, then this is a much more involved change than the one proposed here. |
Another idea could be to print something like:
|
@cmaglie @ubidefeo I'd close this one if it's ok with you. Making the script fail and handling the failure is a different topic than showing its output.
(I modified it here to make it exit with |
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Pipe the forked post install script logs into the parent process (the cli) logs
What is the current behavior?
Post install script logs are not visible when installing a core
What is the new behavior?
stdout and stderr streams of the post install script are shown in the cli stdout and stderr respectively
Does this PR introduce a breaking change, and is titled accordingly?
No, users should not expect to have structured logs from the cli
Other information
Fixes #1675